package com.ciaojian.core.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.ciaojian.core.enums.business.CouponCodeOriginEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 券码
 *
 * @author Atlakyn
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("d_coupon_code")
public class CouponCode extends Model<CouponCode> {
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 券码
     */
    private String code;

    /**
     * 券设置 id
     */
    private Integer couponId;

    /**
     * 状态:
     * 0 未领取 default
     * 1 已领取
     * 2 已使用
     */
    private Integer status;

    /**
     * 第三方兑换码
     */
    private String outsideCode;

    /**
     * 归属用户 id
     */
    private Integer userId;

    @ApiModelProperty("卡券来源")
    private CouponCodeOriginEnum origin;

    @ApiModelProperty("所属订单")
    private Integer orderId;

    @ApiModelProperty("备注")
    private String remark;

    /**
     * 归属用户昵称
     */
    @TableField(value = "nickName")
    private String nickName;

    /**
     * 创建时间
     */
    private Date addTime;

    /**
     * 修改时间
     */
    private Date updateTime;


    @ApiModelProperty("过期时间")
    private Date expiredTime;
}
